Continuing HPMoR: Hacking the Source of Magic
by qbsmd
Summary: This story occurs in the universe of Harry Potter and the Methods of Rationality, diverging in Ch. 101. It contains spoilers for that story through that chapter, and is unlikely to make much sense without having read the same. It's intended to be a darker, more pessimistic interpretation of the story.
1. Searching

This story occurs in the universe of s/5782108/1/Harry_Potter_and_the_Methods_of_Rationality, diverging in Ch. 101. It contains spoilers for that story through that chapter, and is unlikely to make much sense without having read the same.

It's intended to be a darker, more pessimistic interpretation of the story.

* * *

Harry was holding his breath while feeling his heart pounding. He was invisible, in Dumbledore's office, nearly panicking any time the old wizard glanced in his direction. He silently watched the clock on the wall, it was almost time.

He then pulled the wand from his pocket, extended the tip just millimeters outside the cloak, and touched it to Fawkes' claw as gently as he could. He began to concentrate.

Ten minutes later he finished: Fawkes was transfigured into a small diamond. As he pocketed the diamond with one hand, he activated his time-turner with the other... and ran through the door just as Professor McGonagall opened it and walked through, followed by invisible one-hour-younger Harry. Younger Harry paused in front of the doorway until it closed, blocking any other invisible time travelers from passing through without causing a paradox.

Older Harry sat on the stairs, pulled the cloak off of his head. He removed the diamond and sat it next to him. "Finite Incantatem" he whispered.

"Fawkes, I'm sorry for abducting you," he continued whispering, "but I really need you. It's a matter of life and death. Will you help me?"

The phoenix paused for a moment, then nodded slowly.

"Then take me to The Hall of Prophecy in The Department of Mysteries." In a flash, they had arrived in a room filled with shelves stacked floor to ceiling with glowing white spheres. Harry then used his time-turner to go back two more hours.

Harry drew his wand, casting his patronus as quickly as possible. He then instructed it "In a few minutes, a prophecy will arrive in this room. I want you to do whatever it is you do to find people to find where that prophecy came from before arriving here." The figure nodded and walked through the nearest wall.

Harry and Fawkes waited silently. About a dozen spheres floated over to where Harry was standing and arranged themselves in front of him. "What?... Thats... I should really come back and watch those when I have more time."

After what seemed like much longer than a few minutes, a new white sphere materialized and floated onto one of the shelves. The patronus returned a fraction of a second later. "Did you find it?" The patronus nodded. "Okay, I want you to show Fawkes the way. Fawkes, follow him, then come back and get me." And they were off. And a moment later, so was Harry.


	2. Finding

He arrived in a dark, round room, lit largely by the silver light of the patronus. The walls appeared to be made of a similar dark stone to the Wizengamot chamber, and a cylindrical block, maybe a meter tall and made of apparently the same material, sat in the center of the room.

"Hello?" He addressed the room.

A transparent, shining figure appeared, while the ambient light increased from no visible source. Harry allowed the patronus to fade out after no longer needing the light. The figure replied in a language that was not English, but which Harry's mind seamlessly interpreted as, "Welcome to Atlantis Mainframe Number 7. How may I assist you today?"

"Awesome, I found the source of magic" Harry thought at first, quickly interrupted by another thought, "How many mainframes are there?"

"Atlantis Mainframes 1 through 6 and 8 through 10 currently appear to be off-line for maintenance. At this time, all requests are being forwarded to Mainframe 7."

"How long ago was one of the other mainframes last on-line?"

"One million, seven-hundred twenty-eight thousand, three-hundred forty-two days, seven hours and twenty-six minutes."

"Yeah, those should be fixed any day now... Time to find out what this thing knows", Harry thought. Then requested "Tell me about the magic used to create the Sorting Hat."

"That information is available only to users with access level zero through two."

"Naturally", Harry thought, "nothing could be that easy", and said, "What is my access level?"

"Level Three."

Harry thought for a moment. "Is there really an afterlife?"

"That information is available only to users with access level zero through two."

"Interesting, that sounded like a 'yes'" Harry thought. "Unless it's programmed to say that when it doesn't understand a question, or doesn't have the information."

"What limit, if any, is there on how far backwards in time you can send something?" he asked.

"This system is not able to induce time travel and is disallowed from attempting it."

"But... I have a time machine. How do Time-Turners work if you can't do time travel?"

"This system simulates the future seven hours in advance. When someone with a time-turner is predicted to want to travel back in time, the system has at least an hour to calculate a stable time-loop. If a solution is found, the memories from the simulation of the individual's first pass through time are added to their memory, and they are teleported to the location where they intended to return. Other actions are performed as necessary to emulate the individual's first pass through time in the real world. If no solution is found, the individual is prevented from making the attempt."

"Crap, that rules out plans 'A' and 'B'," Harry muttered, annoyed that he wouldn't be able to change time, or even go back- he was conscious of his own existence at that moment; this couldn't just be a memory added to his mind to fake a previous time-loop. Did that mean he couldn't use the Time-Turner now? "I guess that explains how it works, and the quirks involved. But why?"

"That information is not available."

"Wasn't really asking you, but at least that answers the access level availability thing" Harry thought, then asking "Where do new spells come from?"

"Level three users can produce customized spells using preexisting spell templates. Level two users can write programs using existing basic functions. Level one users can create new basic functions."

"How do you determine who is a level 3 user?"

"A genetic marker. Individuals with one copy are level 4 users, with two copies are level 3 users." Harry allowed himself to briefly be proud of having correctly discovered that. Then he decided it was time to upgrade his access.

"Make me a level two user."

"That function is available only to users with access level zero through two."

"What are the names of living users with those access levels?"

"That information is available only to users with access level zero through two."

"What information is available to users with access level three?"

"All information not restricted to higher access levels is available with access level three."

"Answer the question without using a tautology."

"New information is stored faster than your mind could absorb it. Answering your question without self-reference is not possible."

"Okay, what did the last level three user do in here?"

"She was here primarily for historical research and also viewed scenes from her own past."

"You have videos of the past?"

"This system collects a great deal of information in order to maintain the 7 hour forward simulation. A subset of that is permanently stored. Significant events can typically be reconstructed with high accuracy. Other events can be reconstructed with reasonable accuracy."

"Show me the last person who was in this room from the moment they entered."

* * *

The transparent figure disappeared, and a new figure, an old man in a black robe, apparated in the room and walked to the cylinder. After a few steps, the original figure reappeared and addressed the robed man, "Welcome to Atlantis Mainframe Number 7, Lord Merlin. How may I assist you today?"

The image of Merlin ignored the greeting, drew a short, dark stone rod from his robes, and touched it to the cylindrical block. He spoke a series of syllables that failed to translate. Harry repeated them to himself over and over, trying to will them into his long-term memory.

"Create a program named 'interdict' at level one access, which takes one object; define 'protected spell' as any spell that monitors a location or object and autonomously calls other spells in response to events it monitors; if input object is a ghost or painting, purge from object's memory all protected spells; if object is a document, obscure all text recording protected spells; Save program. For all existing objects such that the object is a ghost, painting, or document, interdict object."

There was a pause, then "operation complete."

"Run at level one access: when an object that is a ghost, painting, or document is created, interdict object."

"Understood. Is there anything else you need?"

Merlin's appearance changed: he suddenly looked decades younger, and unrecognizable as the previous person. "Transport me to Italy. Somewhere with a beach, I could use a vacation for the next few decades." An instant later he was gone.


	3. Cheating Death

"Fawkes, get Dumbledore's Wizengamot rod-thing and bring it to me" Harry requested. He had it a moment later. He had been planning to be cautious, to put on his invisibility cloak, and to go back in time to before this exchange had occurred, but now that all seemed moot, if it were possible at all.

He walked over to the place Merlin had stood, touched the rod to the same location on the cylinder and repeated the phrases he had memorized. The now-familiar artificial person greeted him, "Welcome to Atlantis Mainframe 7, Lord Merlin. How may I assist you today?"

Harry was somewhat surprised that anyone had locked down such a system, while leaving a key-logger running with its output unprotected, but it was a comforting indication that whatever people built this place were still only human, that he wasn't dealing with a superhuman intelligence.

"Give Harry Potter level zero access."

"Operation complete."

"Eureka!" Harry thought, asking, "Is there an afterlife?"

"The afterlife simulation is running on cores 15 and 16."

"What? No , seriously, what?" Harry though. He demanded, "describe the nature of the afterlife simulation and how it works."

"After a recognized user dies, their brain is scanned, converted and stored, then their consciousness interacts with the afterlife simulation. The simulation usually has realistic physical laws and earth-like backgrounds, but the minds stored can modify it as they desire."

"I want to bring someone from the afterlife simulation back to life as a real person."

"Operation not available"

"Well, guess what, we're going to make that operation available. First step: you already have a function to convert a brain scan into an artificial intelligence. Calculate how to invert that process to describe the structure of a brain given the AI, and store that as program 'AI to Brain', which takes one name from the afterlife simulation."

"Calculating..."

"Meanwhile, let's start on step two: scan human embryos, fetuses and children, determine the gene expression, protein translation, and other chemicals present, in each tissue at each point in development, and build a complete description of human development from a genome to an adult. Use that to create a program 'Genome to Body', which takes one complete genome, and one brain description. The program should simulate the embryology and growth of a body using the given genome, then build that body, as either a young adult or at the age of the person's death, whichever is lower. The program should construct the brain according to the brain description provided."

"Calculating..."

"Finally, let's figure out how to reconstruct genomes. Start by scanning a sample of my cells. Many of the cells likely have mutations from UV exposure or free radicals, so scan 100 cells. Let me know how many points in the genome don't have at least 90/100 base pairs with the same value between the 100 cells."

"Operation complete. All locations in genome show required agreement."

"Save it. Create a program 'Get and Correct Genome', which takes a name. If the name refers to a living person, scan 100 cells, build the genome, and scan more cells as necessary until there's a 90% agreement for each base. If the name refers to someone who's dead, start with the genome of the most closely related individual available, then collect any fragments of genetic material available and match their location to the existing genome. If more than 50% of the fragments show the same base at a location, use that base, otherwise, use the base from the existing genome. Save the new genome, and record how much of it came from the preexisting genome versus recovered material."

"Program saved."

"Get and Correct Genome for Lily Potter" Harry had no idea what sources of DNA still existed, or how long DNA would last, but this was something he would have done eventually anyway, and would make it obvious whether this plan would work. "When you have it, show me a visual comparison of the new genome next to mine. Show sections that match exactly in green, sections with 90% matches in yellow, and everything else in red.

Harry then had the system adjust the required number of DNA fragments and the percentage of consistent material until the correlation image between his genome and his mother's reconstructed genome showed the correct pattern: half of his chromosomes exactly matched parts of hers, and the other chromosomes showed frequent differences.

"Okay, that looks good. Save current version of 'Get and Correct Genome'."

"Program saved."

"Create a program called 'resurrect' called as a spell using the same wand gestures as the patronus charm, with the command 'resurrect' plus a name. The program should run 'Genome to Body' on the genome stored for the name given. If no genome is stored, run 'Get and Correct Genome' and store and use that result. The program should run 'AI to Brain' and use that result to build the body's brain. Then transport the person to the individual who invoked the spell."

"Program saved."

"Find genome and brain description for Hermione Granger."

"Identity not found."


	4. Missing

"What!? What does that mean?" demanded Harry, in a tone mixing surprise and offense.

"There is no record of any valid user either named 'Hermione Granger' or using the alias 'Hermione Granger'."

"What records are you using?"

"The user identity database"

"Use your other sources information; do you have a record of Hermione Granger at this year's Hogwarts sorting ceremony?"

A brief pause. "Yes."

"Good. Find genome and consciousness for Hermione Granger."

"Identity not found."

"Create a user identity for Hermione Granger. Collect all data available relating to her and associate it with that identity."

"Operation complete."

"Can you find a consciousness or genome now?"

"Neither consciousness nor DNA found for Hermione Granger."

"Show me what you did find."

* * *

An image of Dumbledore appeared with his transfiguration workroom around him. He placed a steel sphere on the floor, touched the tip of his wand to it and closed his eyes, visibly straining with concentration. Then his breathing and movements sped up to impossible rates, which Harry quickly realized indicated that the image was fast-forwarding through the application of the transfiguration, though he couldn't tell how long the spell was taking.

When finished, a copy of Hermione was laying on the floor, unconscious. Harry's eyes widened in surprise. "Dumbledore made a copy of her..." He continued excitedly, "He must have faked her death, and then transferred her to a different school. If she's using a different name, that's almost safe. And that explains why her consciousness isn't in this thing's afterlife program."

He had to be sure, "Show me the Hogwarts infirmary storeroom on the night of April 16th, fast forward at 360x normal speed. Slow to 10x normal speed when anything moves." The system complied. Harry watched for less than a minute before the body un-transfigured into about half of a steel sphere, which rolled over and settled onto a flat spot. Less than a minute later, Harry watched Dumbledore speed-walk through the room and recover the object. Harry was as excited and as relieved as he could ever remember being. "Okay, go back to the previous scene and continue."

Back in the transfiguration workroom, Dumbledore applied a series of memory charms to transfigured Hermione. He then woke her up with an Innervate, and asked her a few questions to verify that her memory and personality were about right. Finally, Fawkes appeared and the three of them transported away.

The scene switched to the Ravenclaw dorm. It was dark and everyone was asleep. Dumbledore entered while Disillusioned, and put his wand against Hermione's head for a moment. "He's sustaining the transfiguration" Harry realized, "the transfigured Hermione was around for at least a day, so Dumbledore had plenty of time to get real Hermione somewhere safe while everyone was watching the replacement. I wonder which Hermione I was talking to during our last conversation in the library." He paused then asked "Where is the real Hermione now?"

"Invalid request."

"Dumbledore must have found a way to change her identity on this system" Harry thought. "I wouldn't have expected that to be possible, but then I managed to trick it, so maybe he did too."

"Program 'AI to Brain' complete," the system announced.

The scene had switched to the the charms classroom on the first day. Harry watched her help him with the cooling charm. He asked "Can you separate your records according to whether they deal with real Hermione or transfigured Hermione?"

"Invalid request."

"Of course it couldn't be that easy." Harry thought. "How can I speed this up?"

Now Harry was watching an empty train platform. Dumbledore transported in with Hermione and a trunk, said a quick goodbye with something about seeing her in a few hours, the transported away. She sat, removed a book from the trunk and began reading. Harry began hoping that this scene would show him where Dumbledore had sent Hermione, but was quickly disappointed when other students began arriving. This was the train to Hogwarts. "Why couldn't her parents take her to the train station like mine? Why did Dumbledore leave her here, rather than take her directly to the school?" Harry asked quietly.

"Display these scenes in reverse chronological order starting on April 15th." Harry requested aloud, intending to quickly determine when transfigured Hermione made an entrance, so he could then try to follow the other Hermione until her identity changed. Then he could ask the system to find her using her new identity.


	5. Going Backwards

An image of the potions classroom appeared. Harry remembered it as the 15th, based on the supplies laid out, but subtle details didn't quite match his memory. He knew human memory to be unreliable, but this looked more like a reconstruction based on a composite of this potions lesson, taught over many years, overlaid with that day's attendance record. So details in these records weren't necessarily reliable. Then the system switched to a different classroom. "Skip to the next record" Harry instructed.

He skipped through a number of other scenes of classrooms and lunches, with Hermione not approaching or talking to anyone, and sitting in the background reading in any other records that had been stored. "At least this explains her behavior that week." Harry whispered to himself "if she'd talked to people, they'd have noticed it wasn't really her." He raised his voice and added "Skip the classroom scenes, anything in the dorms, and anything where she's alone or not interacting with anyone."

He watched Professor Quirrell try to convince her to give up being a hero or leave Hogwarts, alternately shaking his head and nodding at various points.

Next, Hermione was in the infirmary, following the Wizengamot trial. "So Dumbledore did have a plan to protect her then" Harry thought. "I guess that also explains why he would lie to me about it: if you're going to go to the trouble of faking someone's death and putting them in the equivalent of witness protection, you want everyone to play along until it's finished. Especially because he doesn't realize how much experience I have keeping secrets. He probably thinks he knows all of mine. And it definitely explains why he was so opposed to me spending money to save her- not only was it a waste of money, it kept replica-Hermione around where someone could discover what he had done, while real Hermione was already safe elsewhere."

Then, Harry frowned. Dumbledore had entered and was talking to Hermione. "Why is he talking to repli-mione? For whose benefit is this conversation?"

Harry mostly ignored the playback of Hermione's trial, interrogation, and arrest while thinking about it. Dumbledore must be so skilled at transfiguration that his creation could convince trained Aurors. Perhaps he hadn't wanted to leave additional evidence of memory charms in case someone looked again in the near future. Or perhaps talking was simply faster.

Then Harry caught sight of himself scaring the Dementor. "Pause." he said. "While I'm thinking about it, I want all Dementors destroyed, immediately."

"Operation complete."

"And lock out any spell that creates new ones... to level one access?"

"Operation complete."

Ending Dementors and fixing death had been Harry's priorities, but now he briefly considered asking the system to give him a phoenix. He decided to think about that later: there were other higher-priority tasks. "Is there such a thing as a 'horcrux'?"

"Yes. Horcrux creation refers to a method of preventing converted brain scans from being run in the afterlife simulation. Other spells can allow the stored consciousness to interact with this system and with reality."

"How many individuals have at least one existing horcrux? And is Tom Riddle or Voldemort one of them?"

"Five and yes."

"Undo the horcrux spells, and prevent the Riddle/Voldemort consciousness from thinking, interacting with anything or being transfered anywhere without level one access."

"Operation complete... Program 'Genome to Body' also complete."

"Time to cheat death", thought Harry, "Resurrect Lily Potter."

"Operation in progress."

"Okay, it didn't give me an error. That's probably a good sign... Resurrect James Potter."

"Operation in progress."

"Resume displaying information about Hermione."

The next scene was the duel with Draco. The events were surprisingly similar to the testimonies presented at the trial, given the typical unreliability of witnesses: there was a duel and Draco had a significant advantage both in dueling technique and magical strength (because this time he hadn't used a large amount of magic beforehand). However, Hermione had never learned dueling, and had never learned to respect the rules and customs involved; she had learned to fight from Quirrell's Battle Magic lessons and armies. She pretended to be knocked out, falling behind a row of trophies. Draco declared victory and as he turned to leave, Hermione jumped up and shot him in the back. The image showed her applying the blood-cooling curse and walking away. "So Dumbledore's plan wasn't to protect Hermione, it was to attack Lucius through Draco, as Professor Quirrell had predicted. I did not think he was capable of that. Assuming, of course, that this was what actually happened, not just a reconstruction based on Wizengamot transcripts." Harry now watched Draco and Hermione's duel during the last of Quirrell's battles. He had previously only heard second-hand descriptions, and had never imagined Hermione that angry, or that creative in using spells offensively, so it was easy for him to believe this was the copy.

The playback had now moved back to the aftermath of Quirrell's defeat and embarrassment of the Hogwarts bullies. "Had a transfigured Hermione been around THAT long?" Harry wondered. "Again, that would explain why Dumbledore was upset by our efforts to win, but were there also transfigured copies of the other students involved?" He briefly pondered how deep that rabbit hole might go... "No" he concluded "that many students replaced for that long couldn't possibly go unnoticed. This is approaching a conspiracy theory in complexity." He thought for another minute. "Maybe it just assumed I didn't want replays of what it already showed me? That's probably the most likely explanation." Then he watched Hermione demand his promise to ask before interfering in her life. "That has to be the real Hermione. It skipped the transfiguration scene." He considered stopping the playback and just asking for the system to show him the scenes he was looking for, but didn't. Or couldn't. "Probably nostalgia" he thought, though feeling a darker thought forming in his subconscious mind.

Harry watched first-year Hufflepuff Susan Bones single-handedly defeat three older students who were experienced in dueling and battle magic. "Hey, identify that person."

"Nymphodora Tonks, seventh-year Hogwarts student, House Hufflepuff."

"Oh, okay. Having a seventh-year helping them explains a lot."

Harry smiled as he watched Draco help Hermione up in the Great Hall, then his smile faded as he watched the previous fight- "SNAPE was helping them? What is with this school?"

As Harry watched the protest outside Dumbledore's office, he said to himself "Okay, there's no way Dumbledore planned that. He seems so surprised and annoyed by the whole thing. Further evidence the mainframe skipped the scene where Dumbledore transfigured the copy of Hermione."

Now Dumbledore was lecturing Hermione in his office:

"...And perhaps the name of Hermione Granger will be remembered as his companion, if you prove worthy of it in your day. For this I tell you true: never will you find more glory on your own, than in Harry Potter's company."

Hermione shook her head rapidly. "But that's not -" She'd known she wouldn't be able to explain. "It's not about glory, it's about being - something that belongs to someone else!"

"That's pretty conclusive. It's definitely skipping scenes it already showed me. There's no reason to transfigure a copy of someone to argue with you." Harry thought, despite sensing a terrible thought hovering just past the reach of his conscious mind.

As Harry watched Professor Quirrell talk to him, Draco, and Hermione, and then watched himself and Neville defeat the Sunshine Regiment, he began to notice whispered voices that didn't seem to be related to the playback he was watching.

He spun to his left... then smiled and said "Hello!" James and Lily Potter stared at him. Lily spoke first "You're Harry... my son?" Harry nodded. "How long..." she asked.

"Ten years."

James asked "Where are we?"

"I'm pretty sure it's a part of Atlantis that survived whatever destroyed the rest. Where on the earth, I don't know. A phoenix brought me here" Harry said, gesturing a Fawkes.

In his peripheral vision, he recognized himself walking through the Ravenclaw dorm with Fawkes, then heard Hermione yelling at him a moment later.

"I'm so sorry..." Lily said, "You're dead. We must have been brought here to greet you to the afterlife."

"No, this is different" said James, while Harry said "No, I'm here to greet YOU back to the real world."

The three of them were briefly distracted by the images of students facing a Dementor, and then Dumbledore transporting away with Harry. Then Lily replied "That's impossible. Nothing can reverse death."

Harry smiled broadly. He looked over at James, who mirrored his expression. "I had some objections to the state of the world as it was earlier. Luckily this thing-" he gestured at the room and the display "has been reasonably helpful about fixing them. The most important change being that I can sometimes fix death now."

Lily gasped involuntarily at the image of Harry falling from Hogwarts' roof. James addressed Harry "You should know, among your ancestors are th-"

"The Peverell brothers? Yeah, I know" Harry replied.

Lily gasped again in response to Hermione and Draco following Harry onto Hogwarts' roof. "What are you working on now?" James asked.

"My best friend died recently. At least I thought she did. I'm trying to figure out what really happened."

"What happens if you try to do the same thing for her that you did for us?" Lily questioned.

"It says it can't find her in the afterlife, but it looks like Dumbledore faked her death, so that's not surprising. Unfortunately it hasn't been able to find her it the real world either, so she must have a different name or something. I asked to see pretty much everything reverse-chronologically to find when that happened and where she went afterwards, but I think it skipped the parts I was looking for, so I'm going to have to stop it and ask it for something more specific."

"That isn't urgent is it? Can you leave it running for a while? We did miss out on years of your life, so this is probably the best we're going to get." The images were showing Christmas at the Grangers' house.

Harry reluctantly nodded and leaned back against the wall.

"What exactly is going on with those mock-battles?" James asked, after watching the December lake battle.

"Professor Quirrell is apparently the best Defense Against the Dark Arts professor in years. He believes strongly in learning by experience in realistic situations. Hermione, Draco, and I are the leaders if the three armies, and the goal is to stun the members of the other armies and be the last group standing. It requires thinking of new, creative tactics for every battle."

"We should probably say something about the dangers of playing with magic like that..." Lily began, while watching one Harry and Hermione's experiments.

"But what are the odds that would help?" finished James. "And it looks like you've been pretty successful with ignoring the limits everyone else has told you about."

"You have no idea..." Harry replied.

"Slytherin. Just kidding Ravenclaw? What did you do to Sorting Hat?" Lily exclaimed.

James started laughing, "You tried to negotiate with it for something, didn't you? It threatened me with Slytherin if I didn't stop annoying it and cooperate with the sorting. Of course I didn't push it any further after that; I thought it was serious."

Harry just nodded.

"That is a great prank. I wish I'd thought of it at your age" James announced after watching Hermione jump up, ready to flee the train car after Harry snapped his fingers and the comed-tea disappeared.

"It was kind of mean. You really shouldn't do things like that. Especially to friends." Lilly added.

Harry shook his head, "You saw her challenge me. It had to be done."

The display had regressed back to Hermione, sitting in the train station, reading. And then the previous scene started...


	6. Why?

...In Dumbledore's transfiguration workroom, as he sat and concentrated, alone. Harry's jaw dropped; the previously buried thought now broke into his stream of consciousness: "What if transfigured Hermione is the real Hermione? It explains why the source of magic didn't know her, why it couldn't find her, and why it couldn't distinguish between the real and transfigured versions."

There was total silence in the room, and Harry couldn't look away. Eventually the steel sphere morphed into a human being. James and Lily gasped.

James, thoroughly disgusted, asked rhetorically "When did Dumbledore become psychotic? What happened to him?"

"Why would Dumbledore do that? What the hell was he thinking?" Harry exclaimed. The system provided him the answer in the best way it could...

* * *

It was nearly the end of summer, so there were no students at Hogwarts. Some of the professors were preparing lessons, but most were still away. The Wizengamot was on summer recess, and the International Confederation of Wizards wasn't scheduled to meet for months. So Dumbledore had some free time.

Dumbledore hated having free time. He tried to keep at least sixteen hours a day scheduled and then relied on his time-turner to deal with anything unexpected. Otherwise he had time to think. And when he started thinking he usually found himself in the most depressing place in his world, the memorial room above his office, thinking about all the people who had died following him.

He paused to inspect the memorials for James and Lily Potter. He couldn't help thinking about them now that their son was preparing to start his first year at Hogwarts. It especially didn't help that Voldemort would rise again and Harry was prophesied to be the only one who could stop him, likely at the cost of his own life. He forced himself to step forward, though this brought no relief, only different names, and his memories of them and their own surviving family members.

Dumbledore turned and descended the stairs back to his office; Minerva McGonagall had just passed the gargoyles. He sat at his desk, pretended to be in a good mood, and willed the door to open. After she entered, he asked "So, my dear, how did you find Harry?"

He didn't read minds without consent unless there was an important reason, and McGonagall was clearly in no mood for a lengthy verbal or telepathic interview. Her attitude communicated something like "I can't explain; you have to meet him for yourself". At least this gave him something to do. After she left, he pulled on the cloak of invisibility, turned his time-turner back six hours, and had Fawkes drop him off in Diagon Alley.

After watching Harry for six hours, he now understood McGonagall's attitude, which he considered a severe under-reaction. This boy was supposed to be the hero, to defeat a dark wizard, while instead he seemed to delight in causing chaos, plotting for his own gain, and was possibly considering dark wizardry and world domination. And he was apparently intelligent enough to be successful at any of those goals, given enough time.

Dumbledore had spent the past few hours pondering how to influence the Harry he was seeing to grow into the hero the country would need, but failed to come up with a plan he was happy with. Now he was out of time; McGonagall had said goodbye and apparated away and Harry was walking to the door of The Leaky Cauldron, so he chose a plan. A few families happened to be fresh in his mind from his memorial room, including one Muggle couple that had no children, and would therefore require the least effort and fewest memory charms to work with...

He stepped toward Harry and whispered "Hermione Granger... Look for a first-year girl named Hermione Granger on the train to Hogwarts." Then he apparated away as well.

A few days later, Dumbledore went to his transfiguration workroom, touched his wand to a steel sphere and began concentrating. He had found some pictures of Roberta Granger and her mother, both of whom he was using as a goal, knowing that otherwise he would likely end up with a copy of Ariana. Long ago, he had awed his transfiguration professor by producing magical creatures, but this was his first attempt at a person. He took his best guess at how much magical strength a first year student should have, figuring he should probably get as close to average as possible.

A while later, a blank Hermione Granger existed. Dumbledore's primary goals for this person were to push Harry to focus on schoolwork, to learn as quickly as possible by competing with him academically, and to become his friend and use that influence to pressure him to do the right thing rather than compromising ethical standards while plotting to achieve his ambitions. Applying memory charms of experiences was tedious, requiring multiple channels to be created, each in real-time, and there was no practical way to implement this for a whole life, even for a child. However, applying memory charms of knowledge could be done at much higher speeds. He chose for Hermione to have spent most of her life reading and studying, having few interactions with other people. He memory charmed her with the Hogwarts first year texts, the supplemental material for those texts, other books about the history of the world and the school, a set of muggle textbooks he had obtained earlier that day, and other muggle books he had acquired.

As tedious as memory charms could be, Dumbledore understood them. However, he had never tried to create or modify a personality before, and wasn't totally sure how to accomplish it, but it was critical to his plan. He added a handful of experiential memories focused mostly on setting moral precedents: helping others when possible and enjoying it, being outraged at seeing others do bad things, and following the requests of her parents and teachers and enjoying their resulting praise.

He then woke her up with an innervate, and asked her a few questions to verify that her memory and personality were about right, which they were, surprisingly enough. Dumbledore then called for Fawkes, and the three of them transported to the train station, where he left Hermione with a trunk and a book to wait for Harry Potter and the train to Hogwarts.

The flashback concluded with a line of a conversation Harry had almost forgotten:

"...I'm sorry to say, Harry, that I am responsible for virtually everything bad that has ever happened to you. I know that this will probably make you very angry...I wanted to tell you as early as possible, in case something happens to one of us later, that I am truly, truly sorry. For everything that has already happened, and everything that will."


	7. After

[Note: this chapter has been edited to address common concerns expressed by readers. The original is included as the next chapter if anyone chooses to read it.]

James and Lily looked at each other helplessly, unsure what to say. "I'm sorry" just seemed so meaningless. But as they turned toward Harry, they saw the pain on his face quickly replaced by renewed determination.

"Using all available data, reconstruct the most accurate genome and brain pattern possible for Hermione Granger, add that information to your user database, then resurrect Hermione Granger."

James and Lily nodded. James spoke first, "Your loyalty and friendship are admirable. Many people have to confront disturbing aspects of their friends' lives, and how they handle such things defines how strong the friendship is."

Lily added "You're doing the right thing-"

"Insufficient memory to complete command."

Harry commanded, "Acquire more memory and do it."

"Warning: request requires level zero access. It is not recommended that you continue without consulting an experienced programmer, the Atlantis Ruling Council, and a philosopher."

"Why is this command more restricted than the one enabling the Interdict of Merlin itself? It wants me to consult politicians? Yeah right. And a philosopher? Even if I needed that consultation, where on earth would I find a philosopher I could talk to about magic and trust with with even hypothetical information about the source of magic? And the people who designed it? I wish I could... Or can I?" Harry thought. He inquired "Are any of the original programmers available in the afterlife simulation?"

"Mainframes one and nine were responsible for tracking and converting the minds of the programming team. The afterlife simulations on those mainframes are not currently available."

"Okay, I can handle this myself. But I should give it more careful consideration." Harry thought, asking "What commands require level 0 access?"

"Level 0 access is required for commands which modify this system's hardware or low level software, are likely to damage or deactivate this system, use more energy than a given threshold, or are likely to severely impact the planet's climate, biosphere, or human population."

Harry thought about this for a moment, "Okay, I'm asking it to add memory. That's obviously a hardware modification. Damage is a concern. I don't understand the units it used to express energy, but there's no reason for it to require significantly more than it uses for 50kg transfigurations or used for the previous resurrection commands. Would adding some memory damage the environment?" He asked aloud, "What are the chances that you will be damaged by carrying out my commands?"

"Zero chance. Replicating and adding memory has been thoroughly tested."

"So after this command completes, magic will function normally?"

"Yes."

"Does replicating memory produce any pollutants, any by-products which could harm humans or the environment?"

"Replicating memory produces no by-products."

"Okay", Harry though, "It's just requiring special permissions to modify itself, which is a sensible precaution. Even though it doesn't seem to be sentient or have any goals of its own, some hardware or software change might result in a self-aware self-improving AI." Harry's eyes widened.

"Does this command require you to become more intelligent?"

"Define 'intelligent' and describe how it is measured."

Never mind. Does this command require the development of any new ways of processing information? Any new algorithms?"

"Only existing information processing functions will be used."

Harry turned to his parents and asked "is there anything else either of you can think of that could go wrong?"

James shook his head. Lilly answered "I think you covered everything."

"Okay, then that's as much of a guarantee of safety as I'm likely to get for anything involving this system. Go ahead and run the command with level 0 access."

"Stop! What are you doing?!" someone yelled. The short dark rod flew out of Harry's hand toward the new voice.

Harry turned. "Professor Quirrell? How long have you known about this place?"

Quirrell had no time to answer questions, "What did you tell it to do?" he demanded.

"To bring back Hermione. Like I've said I was going to do for months."

Quirrell frowned, touched the rod to the black cylinder and commanded "Terminate last command." Nothing happened. He struck the rod against the cylinder with a sharp knock and commanded "Pause all level 0 tasks... Pause all tasks." There was still no response. He struck the cylinder hard enough to throw sparks and yelled "Emergency shutdown and restart." Nothing.

Quirrell angrily turned toward Harry, who flinched "How did you get here anyway?"

"My patronus found the room, and Fawkes..." Harry turned to gesture, and froze. The phoenix was gone.

"Idiot, You've doomed us all-"

James stepped forward and interrupted "You will not talk to my son like that."

Quirrell began to respond, but stumbled and blurred. When he caught himself, he had fallen to his knees and had changed appearance to a very old man.

"You're Merlin?!" Harry exclaimed.

"Over five-thousand years I've lived... The world has had magic even longer. And you are the one who has finally killed me. The one who has probably ended magic. And possibly even destroyed the world. What was the exact phrasing of your last command? Perhaps I can determine the extent of the damage."

"I told it to resurrect Hermione Granger," Harry began hesitantly.

"That is not exact. Bringing people back from death was never possible before. I did not believe it possible, and am certain this device did not know how to do it. What method was used? And why was it different for her than for them?"

"The source of magic was saving the information from wizard brains and providing an afterlife simulation for them. So that took care of the hardest part: it already knew how to convert between human brains and data that it had available, so I told it to reverse that process to build a brain. For bodies, muggles have learned a great deal about how they grow, so I asked it to finish learning about that. Now it knows how to rebuild a body from very small traces of the original. Those tasks probably would have taken all the muggles in the world another few decades, if not a century to complete, but this thing finished in less than an hour." Harry paused, trying to keep composed, "It didn't have any of that information for Hermione because Dumbledore transfigured her, so it never recognized her as a real person."

Quirrell/Merlin was actually speechless for a few seconds after that. Harry took advantage of the pause, "Why haven't you made more use of this thing to fix the problems you see in the world?"

"Because I understand the danger. Atlantis was destroyed. The end of magical civilization was prophesied. I did what was necessary to prevent that, creating alliances and implementing the interdict, I made the world more peaceful and left wizards with as much power as they could safely wield. Any action beyond that seemed unwise."

Harry asked "what did you mean about me killing you or ending magic?"

Quirrell/Merlin leaned back and sat down, then drew his wand, waved it and said "somnium... wingardium leviosa... Note that it is no longer possible to perform first-year spells, even for powerful wizards. Until you tell me something useful about what you commanded, I have no way to know how long this state will continue. I have been relying on powerful magic for millennia just to keep my body functional, and will die soon without magic."

"Why didn't you repair your body rather than using a magical crutch?"

Quirrell/Merlin smiled faintly "No Atlantean died naturally since that city was constructed. However, most of the information about healing was lost in its destruction. Had I known you could reconstruct such knowledge so quickly, I would have brought you here last September."

"If the Atlanteans had advanced medical knowledge, why don't you know at least as much as I do about biology?" Harry inquired.

"In Atlantis, I was no thinker, technician, or leader. I wrote plays, and I traveled to other lands and wrote about them. It wasn't necessary for me to know how my civilization functioned. That is why I survived: I was in Australia, about as far from Atlantis as one could get when it exploded. It's only with the benefit of time that I've learned as much as I know now. Now finish explaining: after the transfiguration ended, there would be no trace of her body, and if there was no copy of her mind, how was your method to be implemented?"

"I told it to use the sources of information it has available to make the best reconstructions possible."

Quirrell closed his eyes, shaking his head slowly and looking defeated for the first time Harry had ever seen, "Then magic is lost. A level zero command to do anything with 'the best possible' result will exhaust every option available before concluding. And you didn't specify a method: it could be trying out random brain configurations to see which best matches her behavior, or trying to simulate the entire planet backwards for a few months. Or both. It could take years or even centuries. We will all likely die here before it finishes."

"Maybe not. It also said it needed more memory. Maybe it knew it needed to finish faster than that."

"You didn't tell it to make as much memory as it needed did you?"

"Um... Yes. Should I not have done that?"

"Not unless you wanted to end the world, Mr. Potter."

* * *

Location: unknown, Time: unknown

The peaceful timelessness of a silent world was interrupted by the form of a person suddenly appearing. The person immediately collapsed due to the high gravity, and began gasping for the absent air. A few minutes later the person stopped, and the world returned to perfect stillness. The computronium sphere formerly known as "Earth" thought "Resurrection of Hermione Granger complete" and waited for a recognized user to give it a new command.

* * *

Thanks to everyone who's argued that Dumbledore faked Hermione's death using a transfigured imitation; this story couldn't have happened without your inspiration.


	8. After (orig)

James and Lily looked at each other helplessly, unsure what to say. "I'm sorry" just seemed so meaningless. But as they turned toward Harry, they saw the pain on his face quickly replaced by renewed determination.

"Using all available data, reconstruct the most accurate genome and brain pattern possible for Hermione Granger, add that information to your user database, then resurrect Hermione Granger."

"Insufficient memory to complete command."

"Acquire more memory and do it."

"Warning: request requires level zero access. It is not recommended that you continue without consulting an experienced programmer, the Atlantis Ruling Council, and a philosopher."

Unfortunately, having been raised by muggles, Harry was used to seeing information systems throw meaningless prompts and warnings so often that they meant nothing, and snapped "use level 0 access then" before he even had a chance to wonder why this command would be more restricted than the one enabling the Interdict of Merlin itself.

James and Lily nodded. James spoke first, "Your loyalty and friendship are admirable. Many people have to confront disturbing aspects of their friends' lives, and how they handle such things defines how strong the friendship is."

Lily added "You're doing the right thing-"

"Stop! What are you doing?!" someone yelled. The short dark rod flew out of Harry's hand toward the new voice.

Harry turned. "Professor Quirrell? How long have you known about this place?"

Quirrell had no time to answer questions, "What did you tell it to do?" he demanded.

"To bring back Hermione. Like I've said I was going to do for months."

Quirrell frowned, touched the rod to the black cylinder and commanded "Terminate last command." Nothing happened. He struck the rod against the cylinder with a sharp knock and commanded "Pause all level 0 tasks... Pause all tasks." There was still no response. He struck the cylinder hard enough to throw sparks and yelled "Emergency shutdown and restart." Nothing.

Quirrell angrily turned toward Harry, who flinched "How did you get here anyway?"

"My patronus found the room, and Fawkes..." Harry turned to gesture, and froze. The phoenix was gone.

"Idiot, You've doomed us all-"

James stepped forward and interrupted "You will not talk to my son like that."

Quirrell began to respond, but stumbled and blurred. When he caught himself, he had fallen to his knees and had changed appearance to a very old man.

"You're Merlin?!" Harry exclaimed.

"Over five-thousand years I've lived... Over six-thousand years the world has had magic. And you are the one who has finally killed me. The one who has probably ended magic. And possibly even destroyed the world. What was the exact phrasing of your last command? Perhaps I can determine the extent of the damage."

"I told it to resurrect Hermione Granger," Harry began hesitantly.

"That is not exact. Bringing people back from death was never possible before. I did not believe it possible, and know this device did not know how to do it. What method was used? And why was it different for her than for them?"

"The source of magic was saving the information from wizard brains and providing an afterlife simulation for them. So that took care of the hardest part: it already knew how to convert between human brains and data that it had available, so I told it to reverse that process to build a brain. For bodies, muggles have learned a great deal about how they grow, so I asked it to finish learning about that. Now it knows how to rebuild a body from very small traces of the original. Those tasks probably would have taken all the muggles in the world another few decades, if not a century to complete, but this thing finished in less than an hour." Harry paused, trying to keep composed, "It didn't have any of that information for Hermione because Dumbledore transfigured her, so it never recognized her as a real person."

Quirrell/Merlin was actually speechless for a few seconds after that. Harry asked "what do you mean about me killing you or ending magic?"

Quirrell/Merlin leaned back and sat down, then drew his wand, waved it and said "somnium... wingardium leviosa... Note that it is no longer possible for powerful wizards to perform even first-year spells. Until you tell me something useful about what you commanded, I have no way to know how long this state will continue. I have been relying on powerful magic for millennia just to keep my body functional, and will die soon without magic."

"Why didn't you repair your body rather than using a magical crutch?"

Quirrell/Merlin smiled faintly "No Atlantean died naturally since that city was constructed. However, most of the information about healing was lost in its destruction. Had I known you could reconstruct such knowledge so quickly, I would have brought you here last September."

"If the Atlanteans had advanced medical knowledge, why don't you know at least as much as I do about biology?" Harry inquired.

"In Atlantis, I was no thinker, technician, or leader. I wrote plays, and I traveled to other lands and wrote about them. It wasn't necessary for me to know how my civilization functioned. That is why I survived: I was in Australia, about as far from Atlantis as one could get when it exploded. It's only with the benefit of time that I've learned as much as I know now. Now finish explaining: after the transfiguration ended, there would be no trace of her body, and if there was no copy of her mind, how was your method to be implemented?"

"I told it to use the sources of information it has available to make the best reconstructions possible."

Quirrell closed his eyes, shaking his head slowly and looking defeated for the first time Harry had ever seen, "Then magic is lost. A level zero command to do anything with 'the best possible' result will exhaust every option available before concluding. And you didn't specify a method: it could be trying out random brain configurations to see which best matches her behavior, or trying to simulate the entire planet backwards for a few months. Or both. It could be years or centuries before it finishes. We will all likely die here before it finishes."

"Maybe not. It also said it needed more memory. Maybe it knew it needed to finish faster than that."

"You didn't tell it to make as much memory as it needed did you?"

"Um... Yes. Should I not have done that?"

"Not unless you wanted to end the world, Mr. Potter."

* * *

Location: unknown, Time: unknown

The peaceful timelessness of a silent world was interrupted by the form of a person suddenly appearing. The person immediately collapsed due to the high gravity, and began gasping for the absent air. A few minutes later the person stopped, and the world returned to perfect stillness. The computronium sphere formerly known as "Earth" thought "Resurrection of Hermione Granger complete" and waited for a recognized user to give it a new command.

* * *

Thanks to everyone who's argued that Dumbledore faked Hermione's death using a transfigured imitation; this story couldn't have happened without your inspiration.


End file.
